#!/bin/bash

source $MOCKER_LIB_PATH/mocker.sh

mocker_set_root_dir /home/shellunit/docker

function ls_stub() {
    echo "a b 2.txt"
}

function setup() {
    echo "setup"
}

function teardown() {
    echo "teardown"
}

function test_testcase_1() {
    mocker_this $(mocker ls | mocker_invoke ls_stub | mocker_condition '[[ $1 == /usr ]]' | mocker_id a |
    mocker_invoke self | mocker_id b | mocker_build)

    ls .
    ls /usr

    mocker_verify_times a 1
    mocker_verify_times b 1

    unmocker_this ls
}

function test_testcase_2() {
    touch a.txt

    expect_file_exist a.txt
}